--- gl/lib/chdir-long.c.orig	2012-12-15 10:42:45.000000000 -0300
+++ gl/lib/chdir-long.c	2013-03-08 09:44:47.000000000 -0300
@@ -72,7 +72,7 @@
 cdb_advance_fd (struct cd_buf *cdb, char const *dir)
 {
   int new_fd = openat (cdb->fd, dir,
-                       O_SEARCH | O_DIRECTORY | O_NOCTTY | O_NONBLOCK);
+                       O_DIRECTORY | O_NOCTTY | O_NONBLOCK);
   if (new_fd < 0)
     return -1;
 
--- gl/lib/fts.c.orig	2012-12-15 10:42:45.000000000 -0300
+++ gl/lib/fts.c	2013-03-08 09:47:00.000000000 -0300
@@ -364,7 +364,7 @@
 internal_function
 diropen (FTS const *sp, char const *dir)
 {
-  int open_flags = (O_SEARCH | O_DIRECTORY | O_NOCTTY | O_NONBLOCK
+  int open_flags = (O_DIRECTORY | O_NOCTTY | O_NONBLOCK
                     | (ISSET (FTS_PHYSICAL) ? O_NOFOLLOW : 0)
                     | (ISSET (FTS_NOATIME) ? O_NOATIME : 0));
 
@@ -424,7 +424,7 @@
                later (where it'd be messier) that "." can in fact
                be opened.  If not, revert to FTS_NOCHDIR mode.  */
             int fd = open (".",
-                           O_SEARCH | (ISSET (FTS_NOATIME) ? O_NOATIME : 0));
+                           0 | (ISSET (FTS_NOATIME) ? O_NOATIME : 0));
             if (fd < 0)
               {
                 /* Even if "." is unreadable, don't revert to FTS_NOCHDIR mode
@@ -1752,7 +1752,7 @@
       int fd = i_ring_pop (&fd_w);
       if (0 <= fd)
         {
-          int parent_fd = openat (cwd_fd, "..", O_SEARCH | O_NOATIME);
+          int parent_fd = openat (cwd_fd, "..", 0 | O_NOATIME);
           if (parent_fd < 0)
             {
               // Warn?
--- gl/lib/openat-proc.c.orig	2012-12-15 10:42:45.000000000 -0300
+++ gl/lib/openat-proc.c	2013-03-08 09:50:16.000000000 -0300
@@ -75,7 +75,7 @@
          running on Solaris 10.  */
 
       int proc_self_fd = open ("/proc/self/fd",
-                               O_SEARCH | O_DIRECTORY | O_NOCTTY | O_NONBLOCK);
+                               O_DIRECTORY | O_NOCTTY | O_NONBLOCK);
       if (proc_self_fd < 0)
         proc_status = -1;
       else
--- gl/lib/openat.c.orig	2012-12-15 10:42:45.000000000 -0300
+++ gl/lib/openat.c	2013-03-08 09:51:06.000000000 -0300
@@ -265,7 +265,7 @@
 openat_needs_fchdir (void)
 {
   bool needs_fchdir = true;
-  int fd = open ("/", O_SEARCH);
+  int fd = open ("/", 0);
 
   if (0 <= fd)
     {
--- gl/lib/save-cwd.c.orig	2012-12-15 10:42:45.000000000 -0300
+++ gl/lib/save-cwd.c	2013-03-08 09:52:12.000000000 -0300
@@ -64,7 +64,7 @@
 {
   cwd->name = NULL;
 
-  cwd->desc = open (".", O_SEARCH);
+  cwd->desc = open (".", 0);
   if (!GNULIB_FCNTL_SAFER)
     cwd->desc = fd_safer (cwd->desc);
   if (cwd->desc < 0)
